using System;
using Shared.SimpleControl;
namespace Shared
{
///
/// 新风空调
///
[System.Serializable]
public class FreshAir : Common
{
public FreshAir ()
{
Type = DeviceType.FreshAir;
DeviceTextID = 458; //SimpleControl.R.MyInternationalizationString.FreshAir;
}
//新风通道号(1 - 200) + 开关(1,0) + 风速(0 关,1低,2中,3高) + 模式(0手动,1 自动,2 智能,3 定时)
///
/// 开关(1,0)
///
public byte SwitchStatus;
///
/// 风速(0 关,1低,2中,3高)
///
public byte WindSpeed;
///
/// 模式(0--(智能模式/模式0), 1--(新风模式/模式1) 2--(内循环模式/模式2), 3--(恒温模式/模式3))
///
public byte SetPattern;
///
/// 模拟量 2个byte
/// 0启用1不启用
///
public byte EnableValue1;
public byte EnableValue2;
///
/// 室内温度
///
public float InTemp;
///
/// 室外温度
///
public float OutTemp;
///
/// 室内湿度
///
public float Humidity;
///
/// PM2.5
///
public float PM25;
///
/// The tvoc.
///
public float TVOC;
///
/// The CO2.
///
public float CO2;
#region BLL
///
/// 修改备注方法
///
public bool EditRemark (string remake)
{
bool result = false;
byte [] remakeBytes = CommonPage.MyEncodingGB2312.GetBytes (remake);
byte [] resultBytes = Control.ControlBytesSendHasReturn (Command.ReadDeviceLoopInfo, this.SubnetID, this.DeviceID, new byte [] { this.BigClass, this.MinClass, this.LoopID });
if (resultBytes != null) {
byte [] uBytes = new byte [20];
Array.Copy (remakeBytes, 0, uBytes, 0, remakeBytes.Length < 20 ? remakeBytes.Length : 20);
Array.Copy (uBytes, 0, resultBytes, 3, 20 < uBytes.Length ? 20 : uBytes.Length);
var reBytes = Control.ControlBytesSendHasReturn (Command.SetDeviceLoopInfo, this.SubnetID, this.DeviceID, resultBytes);
if (reBytes != null) {
IO.FileUtils.SaveEquipmentMessage (this, this.LoopID.ToString ());
this.Name = remake;
result = true;
}
}
return result;
}
#endregion
}
}